#include "motor.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

void motor_left()
{
  int pin = 13;              
  if (wiringPiSetup () == -1)
    exit (1) ;                                         
  int i; 
  pinMode (pin, OUTPUT);
  for (i=0;i<2;i++) {                      
    
      digitalWrite (pin,HIGH) ;         
      delay (0.5) ; 
      digitalWrite (pin, LOW) ;         
      delay (1) ;        
    }                              
    
  
 
}


void motor_right()
{ 
  int pin = 13;              
  if (wiringPiSetup () == -1)
    exit (1) ;                
 int i;
  pinMode (pin,OUTPUT);
  for (i=0;i<2;i++) {         
    
      digitalWrite (pin,HIGH) ;   
      delay (0.5) ;      
      digitalWrite (pin, LOW) ;
      delay (1) ;  
    }                              
    
  
  
}






void motor_up()
{
  int pin = 12;
  if (wiringPiSetup () == -1)
    exit (1) ;
   int i;
  pinMode (pin, OUTPUT);
  for ( i=0;i<2;i++) {

      digitalWrite (pin,HIGH) ;
      delay (0.5) ;
      digitalWrite (pin, LOW) ;
      delay (1) ;
    }


  
}
void motor_down()
{
  int pin = 12;
  if (wiringPiSetup () == -1)
    exit (1) ;
   int i;
  pinMode (pin, OUTPUT);
  for (i=0;i<2;i++) {

      digitalWrite (pin,HIGH) ;
      delay (0.5) ;
      digitalWrite (pin, LOW) ;
      delay (1) ;
    }


 
}



